#ifndef _GSTVIEWER_H
#define	_GSTVIEWER_H

#include <gtkmm.h>
#include <gst/gst.h>
#include <gst/interfaces/xoverlay.h>
#include <gdk/gdkx.h>
#include <string>

#include <iostream>
using namespace std;

class GstViewer: public Gtk::DrawingArea {
public:
    GstViewer(const char *url);
    virtual ~GstViewer();
    void video_init();
    void video_start();
    void read_video_props(GstPad *pad);
    static void padlink(GstPad *pad, GstPad *peer, gpointer user_data);
protected:
    virtual bool on_expose_event(GdkEventExpose* event);
    string url;
    int xwin;
    gint width;
    gint height;
    bool change_resolution;
    GstElement *bin;
    GstElement *vsink;
    Glib::Mutex mutex;
private:
    
};


extern Gtk::Window *ghghasd;

#endif	/* _GSTVIEWER_H */
